home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
Python 1.3.3
/
stdwin
/
Tools
/
endian.c
< prev
next >
Wrap
Text File
|
1995-12-21
|
255b
|
26 lines
/* Determine byte order. */
#include "endian.h"
int endian;
endianism()
{
union {
short s;
char c[2];
} u;
u.c[0]= 1;
u.c[1]= 2;
switch (u.s) {
case 0x0201:
endian= LIL_ENDIAN;
break;
case 0x0102:
endian= BIG_ENDIAN;
break;
}
}